<template>
    <div class="user">
        <yh-tabs type="card">
            <yh-tab-pane label="菜单" v-if="showResource || checkPermission('B_0326')">
                <span slot="label">
                    <i class="el-icon-tickets"></i>
                    菜单
                </span>
                <div class="user-resource">
                    <UserResource />
                </div>
            </yh-tab-pane>
        </yh-tabs>
    </div>
</template>
<script lang="ts">
import { getUser } from '@/utils/user-util';
import { Component, Vue } from 'vue-property-decorator';
import UserResource from './auth-manage/user-resource.vue';
import { checkPermission } from '@/utils/tools';

@Component({
    name: 'MenuManage',
    components: {
        UserResource,
    },
})
export default class MenuManage extends Vue {
    showResource: boolean = false; // 是否显示字段
    checkPermission = checkPermission;

    mounted() {
        this.showResource = getUser().superuser;
        console.log(this.showResource, 'showResource');
    }
}
</script>
<style lang="scss" scoped>
.user {
    padding-top: 10px;

    .el-tabs__content {
        padding: 1px;

        .el-tab-pane {
            color: #222;
        }
    }

    .uers-list,
    .user-resource {
        margin-top: 20px;
    }
}

.user /deep/.el-tabs .el-tabs__nav .el-tabs__item {
    line-height: 34px;
}
</style>
